<?php
$q = $_GET["q"];
if(!$q){
	exit;
}
include_once( 'initlite.php' );
$s = $c->search_at_users($q);
$sl = "";
$rl = "";
for($i=0; $i<count($s); $i++){
	if($i){
		$sl .= ",";
		$rl .= ",";
	}
	if($s[$i]["remark"]){
		$rl .= "\"".$s[$i]["nickname"]."(".$s[$i]["remark"].")\"";
	}
	else{
		$rl .= "\"".$s[$i]["nickname"]."\"";
	}
	$sl .= "\"".$s[$i]["nickname"]."\"";
}
echo "{\"ats\":[$sl],\"atr\":[$rl]}";
?>